using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace SunshineFarmWord
{
    public class PlayerStateReusableData
    {
        //碰撞层枚举类
        public enum Collider2DTagEnum
        {
            Player,
            Carry,
            Fishing,
            Axe,
            Dig,
            Doing,
            Watering,
            Swimming,
            Hammering,
            Hurt,
            Mining,
            DroppedItems,
            Talking,
            //农作物
            Crops,
            //挖坑完毕之后
            DigOver,
        }

        // 输入数据
        public Vector2 MovementInput { get; set; }
        // 移动基础速度
        public float MovementSpeedModifier { get; set; } = 1f;
        // 移动减速
        public float MovementDecelerationForce { get; set; } = 1f;
        // 朝向
        public PlayerSO.PlayerFaceEnum playerFaceEnum { get; set; } = PlayerSO.PlayerFaceEnum.Right;

        //玩家是否正在移动
        public bool IsMove { get; set; } = false;

        // 是否为步行状态
        public bool IsWalkState { get; set; } = true;
        // 是否为跑步状态
        public bool IsRunState { get; set; } = false;

        // 是否可以进行钓鱼
        public bool IsFishingState { get; set; } = false;

        // 是否可以搬运东西
        public bool IsCarryState { get; set; } = false;

        // 是否可以砍树
        public bool IsAxeingState { get; set; } = false;

        // 是否可以 挖掘
        public bool IsDiggingState { get; set; } = false;

        // 是否可以 采集 和制作
        public bool IsDoingState { get; set; } = false;

        // 是否可以 浇水
        public bool IsWateringState { get; set; } = false;

        // 是否为游泳状态
        public bool IsSwimmingState { get; set; } = false;

        // 是否可以进行 建造
        public bool IsHammeringState { get; set; } = false;

        // 是否可以 挖矿
        public bool IsMiningState { get; set; } = false;

        // 是否可以谈话
        public bool IsTalkingState { get; set; } = false;

        // 其他状态数据
        public PlayerStatesData PlayerStatesData { get; set; }

        //碰撞节点
        public GameObject CollisionNode { get; set; }

        #region Main function 
        // 根据枚举获取当前状态值
        public bool IsInState(Collider2DTagEnum stateEnum)
        {
            switch (stateEnum)
            {
                case Collider2DTagEnum.Axe:
                    return IsAxeingState;
                case Collider2DTagEnum.Fishing:
                    return IsFishingState;
                case Collider2DTagEnum.Dig:
                    return IsDiggingState;
                case Collider2DTagEnum.Mining:
                    return IsMiningState;
                case Collider2DTagEnum.Doing:
                    return IsDoingState;
                case Collider2DTagEnum.Watering:
                    return IsWateringState;
                case Collider2DTagEnum.Talking:
                    return IsTalkingState;
                case Collider2DTagEnum.Hammering:
                    return IsHammeringState;
                default:
                    return false;
            }
        }
        #endregion
    }
}
